home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / Components.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  26.0 KB  |  895 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Components.a
  3. ;
  4. ;    Contains:    Component Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1991-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  18. __COMPONENTS__ SET 1
  19.  
  20.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  21.     include 'Errors.a'
  22.     ENDIF
  23.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  24.     include 'MacTypes.a'
  25.     ENDIF
  26.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  27.     include 'MixedMode.a'
  28.     ENDIF
  29.  
  30.  
  31. kAppleManufacturer                EQU        'appl'                ; Apple supplied components 
  32. kComponentResourceType            EQU        'thng'                ; a components resource type 
  33. kComponentAliasResourceType        EQU        'thga'                ; component alias resource type 
  34.  
  35. kAnyComponentType                EQU        0
  36. kAnyComponentSubType            EQU        0
  37. kAnyComponentManufacturer        EQU        0
  38. kAnyComponentFlagsMask            EQU        0
  39.  
  40. cmpWantsRegisterMessage            EQU        $80000000
  41.  
  42. kComponentOpenSelect            EQU        -1                    ; ComponentInstance for this open 
  43. kComponentCloseSelect            EQU        -2                    ; ComponentInstance for this close 
  44. kComponentCanDoSelect            EQU        -3                    ; selector # being queried 
  45. kComponentVersionSelect            EQU        -4                    ; no params 
  46. kComponentRegisterSelect        EQU        -5                    ; no params 
  47. kComponentTargetSelect            EQU        -6                    ; ComponentInstance for top of call chain 
  48. kComponentUnregisterSelect        EQU        -7                    ; no params 
  49. kComponentGetMPWorkFunctionSelect EQU    -8                    ; some params 
  50. ;  Component Resource Extension flags 
  51.  
  52. componentDoAutoVersion            EQU        $01
  53. componentWantsUnregister        EQU        $02
  54. componentAutoVersionIncludeFlags EQU    $04
  55. componentHasMultiplePlatforms    EQU        $08
  56. componentLoadResident            EQU        $10
  57.  
  58.  
  59. ;  Set Default Component flags 
  60.  
  61. defaultComponentIdentical        EQU        0
  62. defaultComponentAnyFlags        EQU        1
  63. defaultComponentAnyManufacturer    EQU        2
  64. defaultComponentAnySubType        EQU        4
  65. defaultComponentAnyFlagsAnyManufacturer EQU 3
  66. defaultComponentAnyFlagsAnyManufacturerAnySubType EQU 7
  67. ;  RegisterComponentResource flags 
  68.  
  69. registerComponentGlobal            EQU        1
  70. registerComponentNoDuplicates    EQU        2
  71. registerComponentAfterExisting    EQU        4
  72. registerComponentAliasesOnly    EQU        8
  73.  
  74. ComponentDescription    RECORD 0
  75. componentType             ds.l    1                ; offset: $0 (0)        ;  A unique 4-byte code indentifying the command set 
  76. componentSubType         ds.l    1                ; offset: $4 (4)        ;  Particular flavor of this instance 
  77. componentManufacturer     ds.l    1                ; offset: $8 (8)        ;  Vendor indentification 
  78. componentFlags             ds.l    1                ; offset: $C (12)        ;  8 each for Component,Type,SubType,Manuf/revision 
  79. componentFlagsMask         ds.l    1                ; offset: $10 (16)        ;  Mask for specifying which flags to consider in search, zero during registration 
  80. sizeof                     EQU *                    ; size:   $14 (20)
  81.                         ENDR
  82.  
  83. ResourceSpec            RECORD 0
  84. resType                     ds.l    1                ; offset: $0 (0)        ;  4-byte code  
  85. resID                     ds.w    1                ; offset: $4 (4)        ;               
  86. sizeof                     EQU *                    ; size:   $6 (6)
  87.                         ENDR
  88. ComponentResource        RECORD 0
  89. cd                         ds        ComponentDescription ; offset: $0 (0)    ;  Registration parameters 
  90. component                 ds        ResourceSpec    ; offset: $14 (20)        ;  resource where Component code is found 
  91. componentName             ds        ResourceSpec    ; offset: $1A (26)        ;  name string resource 
  92. componentInfo             ds        ResourceSpec    ; offset: $20 (32)        ;  info string resource 
  93. componentIcon             ds        ResourceSpec    ; offset: $26 (38)        ;  icon resource 
  94. sizeof                     EQU *                    ; size:   $2C (44)
  95.                         ENDR
  96. ; typedef struct ComponentResource *    ComponentResourcePtr
  97.  
  98. ; typedef ComponentResourcePtr *        ComponentResourceHandle
  99.  
  100. ComponentPlatformInfo    RECORD 0
  101. componentFlags             ds.l    1                ; offset: $0 (0)        ;  flags of Component 
  102. component                 ds        ResourceSpec    ; offset: $4 (4)        ;  resource where Component code is found 
  103. platformType             ds.w    1                ; offset: $A (10)        ;  gestaltSysArchitecture result 
  104. sizeof                     EQU *                    ; size:   $C (12)
  105.                         ENDR
  106. ComponentResourceExtension RECORD 0
  107. componentVersion         ds.l    1                ; offset: $0 (0)        ;  version of Component 
  108. componentRegisterFlags     ds.l    1                ; offset: $4 (4)        ;  flags for registration 
  109. componentIconFamily         ds.w    1                ; offset: $8 (8)        ;  resource id of Icon Family 
  110. sizeof                     EQU *                    ; size:   $A (10)
  111.                         ENDR
  112. ComponentPlatformInfoArray RECORD 0
  113. count                     ds.l    1                ; offset: $0 (0)
  114. platformArray             ds        ComponentPlatformInfo ; offset: $4 (4) <-- really an array of length one
  115. sizeof                     EQU *                    ; size:   $10 (16)
  116.                         ENDR
  117. ExtComponentResource    RECORD 0
  118. cd                         ds        ComponentDescription ; offset: $0 (0)    ;  registration parameters 
  119. component                 ds        ResourceSpec    ; offset: $14 (20)        ;  resource where Component code is found 
  120. componentName             ds        ResourceSpec    ; offset: $1A (26)        ;  name string resource 
  121. componentInfo             ds        ResourceSpec    ; offset: $20 (32)        ;  info string resource 
  122. componentIcon             ds        ResourceSpec    ; offset: $26 (38)        ;  icon resource 
  123. componentVersion         ds.l    1                ; offset: $2C (44)        ;  version of Component 
  124. componentRegisterFlags     ds.l    1                ; offset: $30 (48)        ;  flags for registration 
  125. componentIconFamily         ds.w    1                ; offset: $34 (52)        ;  resource id of Icon Family 
  126. count                     ds.l    1                ; offset: $36 (54)        ;  elements in platformArray 
  127. platformArray             ds        ComponentPlatformInfo ; offset: $3A (58) <-- really an array of length one
  128. sizeof                     EQU *                    ; size:   $46 (70)
  129.                         ENDR
  130. ComponentAliasResource    RECORD 0
  131. cr                         ds        ComponentResource ; offset: $0 (0)        ;  Registration parameters 
  132. aliasCD                     ds        ComponentDescription ; offset: $2C (44) ;  component alias description 
  133. sizeof                     EQU *                    ; size:   $40 (64)
  134.                         ENDR
  135. ;   Structure received by Component:        
  136. ComponentParameters        RECORD 0
  137. flags                     ds.b    1                ; offset: $0 (0)        ;  call modifiers: sync/async, deferred, immed, etc 
  138. paramSize                 ds.b    1                ; offset: $1 (1)        ;  size in bytes of actual parameters passed to this call 
  139. what                     ds.w    1                ; offset: $2 (2)        ;  routine selector, negative for Component management calls 
  140. params                     ds.l    1                ; offset: $4 (4) <-- really an array of length one ;  actual parameters for the indicated routine 
  141. sizeof                     EQU *                    ; size:   $8 (8)
  142.                         ENDR
  143. ComponentRecord            RECORD 0
  144. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  145. sizeof                     EQU *                    ; size:   $4 (4)
  146.                         ENDR
  147. ; typedef struct ComponentRecord *        Component
  148.  
  149. ComponentInstanceRecord    RECORD 0
  150. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  151. sizeof                     EQU *                    ; size:   $4 (4)
  152.                         ENDR
  153. ; typedef struct ComponentInstanceRecord * ComponentInstance
  154.  
  155. RegisteredComponentRecord RECORD 0
  156. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  157. sizeof                     EQU *                    ; size:   $4 (4)
  158.                         ENDR
  159. RegisteredComponentInstanceRecord RECORD 0
  160. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  161. sizeof                     EQU *                    ; size:   $4 (4)
  162.                         ENDR
  163. ; typedef struct RegisteredComponentInstanceRecord * RegisteredComponentInstanceRecordPtr
  164.  
  165. ; typedef long                             ComponentResult
  166.  
  167.  
  168. platform68k                        EQU        1                    ; platform type (response from gestaltSysArchitecture) 
  169. platformPowerPC                    EQU        2
  170. platformInterpreted                EQU        3
  171. platformWin32                    EQU        4
  172.  
  173. mpWorkFlagDoWork                EQU        $01
  174. mpWorkFlagDoCompletion            EQU        $02
  175. mpWorkFlagCopyWorkBlock            EQU        $04
  176. mpWorkFlagDontBlock                EQU        $08
  177. mpWorkFlagGetProcessorCount        EQU        $10
  178. mpWorkFlagGetIsRunning            EQU        $40
  179. ComponentMPWorkFunctionHeaderRecord RECORD 0
  180. headerSize                 ds.l    1                ; offset: $0 (0)
  181. recordSize                 ds.l    1                ; offset: $4 (4)
  182. workFlags                 ds.l    1                ; offset: $8 (8)
  183. processorCount             ds.w    1                ; offset: $C (12)
  184. unused                     ds.b    1                ; offset: $E (14)
  185. isRunning                 ds.b    1                ; offset: $F (15)
  186. sizeof                     EQU *                    ; size:   $10 (16)
  187.                         ENDR
  188. ; typedef struct ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr
  189.  
  190. ;    The parameter list for each ComponentFunction is unique. It is
  191. ;    therefore up to users to create the appropriate procInfo for their
  192. ;    own ComponentFunctions where necessary.
  193. ;
  194.  
  195. ; typedef UniversalProcPtr                 ComponentFunctionUPP
  196.  
  197.  
  198. ; ********************************************************
  199. ;*                                                        *
  200. ;*                  APPLICATION LEVEL CALLS                    *
  201. ;*                                                        *
  202. ;*******************************************************
  203.  
  204. ; ********************************************************
  205. ;* Component Database Add, Delete, and Query Routines
  206. ;*******************************************************
  207.  
  208. ;
  209. ; pascal Component RegisterComponent(ComponentDescription *cd, ComponentRoutineUPP componentEntryPoint, short global, Handle componentName, Handle componentInfo, Handle componentIcon)
  210. ;
  211.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  212.         Macro
  213.         _RegisterComponent
  214.             moveq               #1,D0
  215.             dc.w                $A82A
  216.         EndM
  217.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  218.         IMPORT_CFM_FUNCTION RegisterComponent
  219.     ENDIF
  220.  
  221. ;
  222. ; pascal Component RegisterComponentResource(ComponentResourceHandle cr, short global)
  223. ;
  224.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  225.         Macro
  226.         _RegisterComponentResource
  227.             moveq               #18,D0
  228.             dc.w                $A82A
  229.         EndM
  230.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  231.         IMPORT_CFM_FUNCTION RegisterComponentResource
  232.     ENDIF
  233.  
  234. ;
  235. ; pascal OSErr UnregisterComponent(Component aComponent)
  236. ;
  237.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  238.         Macro
  239.         _UnregisterComponent
  240.             moveq               #2,D0
  241.             dc.w                $A82A
  242.         EndM
  243.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  244.         IMPORT_CFM_FUNCTION UnregisterComponent
  245.     ENDIF
  246.  
  247. ;
  248. ; pascal Component FindNextComponent(Component aComponent, ComponentDescription *looking)
  249. ;
  250.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  251.         Macro
  252.         _FindNextComponent
  253.             moveq               #4,D0
  254.             dc.w                $A82A
  255.         EndM
  256.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  257.         IMPORT_CFM_FUNCTION FindNextComponent
  258.     ENDIF
  259.  
  260. ;
  261. ; pascal long CountComponents(ComponentDescription *looking)
  262. ;
  263.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  264.         Macro
  265.         _CountComponents
  266.             moveq               #3,D0
  267.             dc.w                $A82A
  268.         EndM
  269.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  270.         IMPORT_CFM_FUNCTION CountComponents
  271.     ENDIF
  272.  
  273. ;
  274. ; pascal OSErr GetComponentInfo(Component aComponent, ComponentDescription *cd, Handle componentName, Handle componentInfo, Handle componentIcon)
  275. ;
  276.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  277.         Macro
  278.         _GetComponentInfo
  279.             moveq               #5,D0
  280.             dc.w                $A82A
  281.         EndM
  282.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  283.         IMPORT_CFM_FUNCTION GetComponentInfo
  284.     ENDIF
  285.  
  286. ;
  287. ; pascal long GetComponentListModSeed(void )
  288. ;
  289.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  290.         Macro
  291.         _GetComponentListModSeed
  292.             moveq               #6,D0
  293.             dc.w                $A82A
  294.         EndM
  295.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  296.         IMPORT_CFM_FUNCTION GetComponentListModSeed
  297.     ENDIF
  298.  
  299. ;
  300. ; pascal long GetComponentTypeModSeed(OSType componentType)
  301. ;
  302.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  303.         Macro
  304.         _GetComponentTypeModSeed
  305.             moveq               #44,D0
  306.             dc.w                $A82A
  307.         EndM
  308.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  309.         IMPORT_CFM_FUNCTION GetComponentTypeModSeed
  310.     ENDIF
  311.  
  312. ; ********************************************************
  313. ;* Component Instance Allocation and dispatch routines
  314. ;*******************************************************
  315.  
  316. ;
  317. ; pascal OSErr OpenAComponent(Component aComponent, ComponentInstance *ci)
  318. ;
  319.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  320.         Macro
  321.         _OpenAComponent
  322.             moveq               #45,D0
  323.             dc.w                $A82A
  324.         EndM
  325.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  326.         IMPORT_CFM_FUNCTION OpenAComponent
  327.     ENDIF
  328.  
  329. ;
  330. ; pascal ComponentInstance OpenComponent(Component aComponent)
  331. ;
  332.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  333.         Macro
  334.         _OpenComponent
  335.             moveq               #7,D0
  336.             dc.w                $A82A
  337.         EndM
  338.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  339.         IMPORT_CFM_FUNCTION OpenComponent
  340.     ENDIF
  341.  
  342. ;
  343. ; pascal OSErr CloseComponent(ComponentInstance aComponentInstance)
  344. ;
  345.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  346.         Macro
  347.         _CloseComponent
  348.             moveq               #8,D0
  349.             dc.w                $A82A
  350.         EndM
  351.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  352.         IMPORT_CFM_FUNCTION CloseComponent
  353.     ENDIF
  354.  
  355. ;
  356. ; pascal OSErr GetComponentInstanceError(ComponentInstance aComponentInstance)
  357. ;
  358.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  359.         Macro
  360.         _GetComponentInstanceError
  361.             moveq               #10,D0
  362.             dc.w                $A82A
  363.         EndM
  364.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  365.         IMPORT_CFM_FUNCTION GetComponentInstanceError
  366.     ENDIF
  367.  
  368. ; ********************************************************
  369. ;*                                                        *
  370. ;*                      CALLS MADE BY COMPONENTS              *
  371. ;*                                                        *
  372. ;*******************************************************
  373.  
  374. ; ********************************************************
  375. ;* Component Management routines
  376. ;*******************************************************
  377.  
  378. ;
  379. ; pascal void SetComponentInstanceError(ComponentInstance aComponentInstance, OSErr theError)
  380. ;
  381.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  382.         Macro
  383.         _SetComponentInstanceError
  384.             moveq               #11,D0
  385.             dc.w                $A82A
  386.         EndM
  387.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  388.         IMPORT_CFM_FUNCTION SetComponentInstanceError
  389.     ENDIF
  390.  
  391. ;
  392. ; pascal long GetComponentRefcon(Component aComponent)
  393. ;
  394.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  395.         Macro
  396.         _GetComponentRefcon
  397.             moveq               #16,D0
  398.             dc.w                $A82A
  399.         EndM
  400.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  401.         IMPORT_CFM_FUNCTION GetComponentRefcon
  402.     ENDIF
  403.  
  404. ;
  405. ; pascal void SetComponentRefcon(Component aComponent, long theRefcon)
  406. ;
  407.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  408.         Macro
  409.         _SetComponentRefcon
  410.             moveq               #17,D0
  411.             dc.w                $A82A
  412.         EndM
  413.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  414.         IMPORT_CFM_FUNCTION SetComponentRefcon
  415.     ENDIF
  416.  
  417. ;
  418. ; pascal short OpenComponentResFile(Component aComponent)
  419. ;
  420.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  421.         Macro
  422.         _OpenComponentResFile
  423.             moveq               #21,D0
  424.             dc.w                $A82A
  425.         EndM
  426.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  427.         IMPORT_CFM_FUNCTION OpenComponentResFile
  428.     ENDIF
  429.  
  430. ;
  431. ; pascal OSErr OpenAComponentResFile(Component aComponent, short *resRef)
  432. ;
  433.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  434.         Macro
  435.         _OpenAComponentResFile
  436.             moveq               #47,D0
  437.             dc.w                $A82A
  438.         EndM
  439.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  440.         IMPORT_CFM_FUNCTION OpenAComponentResFile
  441.     ENDIF
  442.  
  443. ;
  444. ; pascal OSErr CloseComponentResFile(short refnum)
  445. ;
  446.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  447.         Macro
  448.         _CloseComponentResFile
  449.             moveq               #24,D0
  450.             dc.w                $A82A
  451.         EndM
  452.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  453.         IMPORT_CFM_FUNCTION CloseComponentResFile
  454.     ENDIF
  455.  
  456. ;
  457. ; pascal OSErr GetComponentResource(Component aComponent, OSType resType, short resID, Handle *theResource)
  458. ;
  459.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  460.         Macro
  461.         _GetComponentResource
  462.             moveq               #53,D0
  463.             dc.w                $A82A
  464.         EndM
  465.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  466.         IMPORT_CFM_FUNCTION GetComponentResource
  467.     ENDIF
  468.  
  469. ;
  470. ; pascal OSErr GetComponentIndString(Component aComponent, Str255 theString, short strListID, short index)
  471. ;
  472.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  473.         Macro
  474.         _GetComponentIndString
  475.             moveq               #54,D0
  476.             dc.w                $A82A
  477.         EndM
  478.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  479.         IMPORT_CFM_FUNCTION GetComponentIndString
  480.     ENDIF
  481.  
  482. ;
  483. ; pascal Component ResolveComponentAlias(Component aComponent)
  484. ;
  485.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  486.         Macro
  487.         _ResolveComponentAlias
  488.             moveq               #32,D0
  489.             dc.w                $A82A
  490.         EndM
  491.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  492.         IMPORT_CFM_FUNCTION ResolveComponentAlias
  493.     ENDIF
  494.  
  495. ; ********************************************************
  496. ;* Component Instance Management routines
  497. ;*******************************************************
  498.  
  499. ;
  500. ; pascal Handle GetComponentInstanceStorage(ComponentInstance aComponentInstance)
  501. ;
  502.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  503.         Macro
  504.         _GetComponentInstanceStorage
  505.             moveq               #12,D0
  506.             dc.w                $A82A
  507.         EndM
  508.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  509.         IMPORT_CFM_FUNCTION GetComponentInstanceStorage
  510.     ENDIF
  511.  
  512. ;
  513. ; pascal void SetComponentInstanceStorage(ComponentInstance aComponentInstance, Handle theStorage)
  514. ;
  515.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  516.         Macro
  517.         _SetComponentInstanceStorage
  518.             moveq               #13,D0
  519.             dc.w                $A82A
  520.         EndM
  521.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  522.         IMPORT_CFM_FUNCTION SetComponentInstanceStorage
  523.     ENDIF
  524.  
  525. ;
  526. ; pascal long GetComponentInstanceA5(ComponentInstance aComponentInstance)
  527. ;
  528.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  529.         Macro
  530.         _GetComponentInstanceA5
  531.             moveq               #14,D0
  532.             dc.w                $A82A
  533.         EndM
  534.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  535.         IMPORT_CFM_FUNCTION GetComponentInstanceA5
  536.     ENDIF
  537.  
  538. ;
  539. ; pascal void SetComponentInstanceA5(ComponentInstance aComponentInstance, long theA5)
  540. ;
  541.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  542.         Macro
  543.         _SetComponentInstanceA5
  544.             moveq               #15,D0
  545.             dc.w                $A82A
  546.         EndM
  547.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  548.         IMPORT_CFM_FUNCTION SetComponentInstanceA5
  549.     ENDIF
  550.  
  551. ;
  552. ; pascal long CountComponentInstances(Component aComponent)
  553. ;
  554.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  555.         Macro
  556.         _CountComponentInstances
  557.             moveq               #19,D0
  558.             dc.w                $A82A
  559.         EndM
  560.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  561.         IMPORT_CFM_FUNCTION CountComponentInstances
  562.     ENDIF
  563.  
  564. ;  useful helper routines for convenient method dispatching 
  565. ;
  566. ; pascal long CallComponentFunction(ComponentParameters *params, ComponentFunctionUPP func)
  567. ;
  568.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  569.         Macro
  570.         _CallComponentFunction
  571.             moveq               #-1,D0
  572.             dc.w                $A82A
  573.         EndM
  574.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  575.         IMPORT_CFM_FUNCTION CallComponentFunction
  576.     ENDIF
  577.  
  578. ;
  579. ; pascal long CallComponentFunctionWithStorage(Handle storage, ComponentParameters *params, ComponentFunctionUPP func)
  580. ;
  581.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  582.         Macro
  583.         _CallComponentFunctionWithStorage
  584.             moveq               #-1,D0
  585.             dc.w                $A82A
  586.         EndM
  587.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  588.         IMPORT_CFM_FUNCTION CallComponentFunctionWithStorage
  589.     ENDIF
  590.  
  591.     IF TARGET_CPU_PPC ** TARGET_OS_MAC THEN
  592. ;
  593. ; pascal long CallComponentFunctionWithStorageProcInfo(Handle storage, ComponentParameters *params, ProcPtr func, long funcProcInfo)
  594. ;
  595.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  596.         IMPORT_CFM_FUNCTION CallComponentFunctionWithStorageProcInfo
  597.     ENDIF
  598.  
  599.     ELSE
  600.     ENDIF
  601. ;
  602. ; pascal long DelegateComponentCall(ComponentParameters *originalParams, ComponentInstance ci)
  603. ;
  604.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  605.         Macro
  606.         _DelegateComponentCall
  607.             moveq               #36,D0
  608.             dc.w                $A82A
  609.         EndM
  610.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  611.         IMPORT_CFM_FUNCTION DelegateComponentCall
  612.     ENDIF
  613.  
  614. ;
  615. ; pascal OSErr SetDefaultComponent(Component aComponent, short flags)
  616. ;
  617.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  618.         Macro
  619.         _SetDefaultComponent
  620.             moveq               #30,D0
  621.             dc.w                $A82A
  622.         EndM
  623.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  624.         IMPORT_CFM_FUNCTION SetDefaultComponent
  625.     ENDIF
  626.  
  627. ;
  628. ; pascal ComponentInstance OpenDefaultComponent(OSType componentType, OSType componentSubType)
  629. ;
  630.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  631.         Macro
  632.         _OpenDefaultComponent
  633.             moveq               #33,D0
  634.             dc.w                $A82A
  635.         EndM
  636.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  637.         IMPORT_CFM_FUNCTION OpenDefaultComponent
  638.     ENDIF
  639.  
  640. ;
  641. ; pascal OSErr OpenADefaultComponent(OSType componentType, OSType componentSubType, ComponentInstance *ci)
  642. ;
  643.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  644.         Macro
  645.         _OpenADefaultComponent
  646.             moveq               #46,D0
  647.             dc.w                $A82A
  648.         EndM
  649.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  650.         IMPORT_CFM_FUNCTION OpenADefaultComponent
  651.     ENDIF
  652.  
  653. ;
  654. ; pascal Component CaptureComponent(Component capturedComponent, Component capturingComponent)
  655. ;
  656.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  657.         Macro
  658.         _CaptureComponent
  659.             moveq               #28,D0
  660.             dc.w                $A82A
  661.         EndM
  662.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  663.         IMPORT_CFM_FUNCTION CaptureComponent
  664.     ENDIF
  665.  
  666. ;
  667. ; pascal OSErr UncaptureComponent(Component aComponent)
  668. ;
  669.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  670.         Macro
  671.         _UncaptureComponent
  672.             moveq               #29,D0
  673.             dc.w                $A82A
  674.         EndM
  675.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  676.         IMPORT_CFM_FUNCTION UncaptureComponent
  677.     ENDIF
  678.  
  679. ;
  680. ; pascal long RegisterComponentResourceFile(short resRefNum, short global)
  681. ;
  682.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  683.         Macro
  684.         _RegisterComponentResourceFile
  685.             moveq               #20,D0
  686.             dc.w                $A82A
  687.         EndM
  688.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  689.         IMPORT_CFM_FUNCTION RegisterComponentResourceFile
  690.     ENDIF
  691.  
  692. ;
  693. ; pascal OSErr GetComponentIconSuite(Component aComponent, Handle *iconSuite)
  694. ;
  695.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  696.         Macro
  697.         _GetComponentIconSuite
  698.             moveq               #41,D0
  699.             dc.w                $A82A
  700.         EndM
  701.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  702.         IMPORT_CFM_FUNCTION GetComponentIconSuite
  703.     ENDIF
  704.  
  705.  
  706. ; ********************************************************
  707. ;*                                                        *
  708. ;*              Direct calls to the Components                *
  709. ;*                                                        *
  710. ;*******************************************************
  711.  
  712. ;  Old style names
  713.  
  714. ;
  715. ; pascal long ComponentFunctionImplemented(ComponentInstance ci, short ftnNumber)
  716. ;
  717.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  718.         Macro
  719.         _ComponentFunctionImplemented
  720.             move.l              #$0002FFFD,-(sp)
  721.             moveq               #0,D0
  722.             dc.w                $A82A
  723.         EndM
  724.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  725.         IMPORT_CFM_FUNCTION ComponentFunctionImplemented
  726.     ENDIF
  727.  
  728. ;
  729. ; pascal long GetComponentVersion(ComponentInstance ci)
  730. ;
  731.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  732.         Macro
  733.         _GetComponentVersion
  734.             move.l              #$0000FFFC,-(sp)
  735.             moveq               #0,D0
  736.             dc.w                $A82A
  737.         EndM
  738.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  739.         IMPORT_CFM_FUNCTION GetComponentVersion
  740.     ENDIF
  741.  
  742. ;
  743. ; pascal long ComponentSetTarget(ComponentInstance ci, ComponentInstance target)
  744. ;
  745.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  746.         Macro
  747.         _ComponentSetTarget
  748.             move.l              #$0004FFFA,-(sp)
  749.             moveq               #0,D0
  750.             dc.w                $A82A
  751.         EndM
  752.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  753.         IMPORT_CFM_FUNCTION ComponentSetTarget
  754.     ENDIF
  755.  
  756. ;  New style names
  757.  
  758. ;
  759. ; pascal ComponentResult CallComponentOpen(ComponentInstance ci, ComponentInstance self)
  760. ;
  761.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  762.         Macro
  763.         _CallComponentOpen
  764.             move.l              #$0004FFFF,-(sp)
  765.             moveq               #0,D0
  766.             dc.w                $A82A
  767.         EndM
  768.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  769.         IMPORT_CFM_FUNCTION CallComponentOpen
  770.     ENDIF
  771.  
  772. ;
  773. ; pascal ComponentResult CallComponentClose(ComponentInstance ci, ComponentInstance self)
  774. ;
  775.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  776.         Macro
  777.         _CallComponentClose
  778.             move.l              #$0004FFFE,-(sp)
  779.             moveq               #0,D0
  780.             dc.w                $A82A
  781.         EndM
  782.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  783.         IMPORT_CFM_FUNCTION CallComponentClose
  784.     ENDIF
  785.  
  786. ;
  787. ; pascal ComponentResult CallComponentCanDo(ComponentInstance ci, short ftnNumber)
  788. ;
  789.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  790.         Macro
  791.         _CallComponentCanDo
  792.             move.l              #$0002FFFD,-(sp)
  793.             moveq               #0,D0
  794.             dc.w                $A82A
  795.         EndM
  796.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  797.         IMPORT_CFM_FUNCTION CallComponentCanDo
  798.     ENDIF
  799.  
  800. ;
  801. ; pascal ComponentResult CallComponentVersion(ComponentInstance ci)
  802. ;
  803.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  804.         Macro
  805.         _CallComponentVersion
  806.             move.l              #$0000FFFC,-(sp)
  807.             moveq               #0,D0
  808.             dc.w                $A82A
  809.         EndM
  810.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  811.         IMPORT_CFM_FUNCTION CallComponentVersion
  812.     ENDIF
  813.  
  814. ;
  815. ; pascal ComponentResult CallComponentRegister(ComponentInstance ci)
  816. ;
  817.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  818.         Macro
  819.         _CallComponentRegister
  820.             move.l              #$0000FFFB,-(sp)
  821.             moveq               #0,D0
  822.             dc.w                $A82A
  823.         EndM
  824.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  825.         IMPORT_CFM_FUNCTION CallComponentRegister
  826.     ENDIF
  827.  
  828. ;
  829. ; pascal ComponentResult CallComponentTarget(ComponentInstance ci, ComponentInstance target)
  830. ;
  831.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  832.         Macro
  833.         _CallComponentTarget
  834.             move.l              #$0004FFFA,-(sp)
  835.             moveq               #0,D0
  836.             dc.w                $A82A
  837.         EndM
  838.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  839.         IMPORT_CFM_FUNCTION CallComponentTarget
  840.     ENDIF
  841.  
  842. ;
  843. ; pascal ComponentResult CallComponentUnregister(ComponentInstance ci)
  844. ;
  845.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  846.         Macro
  847.         _CallComponentUnregister
  848.             move.l              #$0000FFF9,-(sp)
  849.             moveq               #0,D0
  850.             dc.w                $A82A
  851.         EndM
  852.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  853.         IMPORT_CFM_FUNCTION CallComponentUnregister
  854.     ENDIF
  855.  
  856. ;
  857. ; pascal ComponentResult CallComponentGetMPWorkFunction(ComponentInstance ci, ComponentMPWorkFunctionUPP *workFunction, void **refCon)
  858. ;
  859.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  860.         Macro
  861.         _CallComponentGetMPWorkFunction
  862.             move.l              #$0008FFF8,-(sp)
  863.             moveq               #0,D0
  864.             dc.w                $A82A
  865.         EndM
  866.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  867.         IMPORT_CFM_FUNCTION CallComponentGetMPWorkFunction
  868.     ENDIF
  869.  
  870.  
  871.     IF ¬ TARGET_OS_MAC THEN
  872. ;  
  873. ;        CallComponent is used by ComponentGlue routines to manually call a component function.
  874. ;     
  875.  
  876. ;
  877. ; pascal ComponentResult CallComponent(ComponentInstance ci, ComponentParameters *cp)
  878. ;
  879.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  880.         IMPORT_CFM_FUNCTION CallComponent
  881.     ENDIF
  882.  
  883.     ENDIF
  884. ;  UPP call backs 
  885. ;  ProcInfos 
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.     ENDIF ; __COMPONENTS__ 
  893.  
  894.